{extend name="default/base/base_joinin" /}
{block name="joinin_main"}

<div class="breadcrumb"><span class="iconfont">&#xe6ff;</span><span><a href="">{$Think.lang.homepage}</a></span> <span class="arrow">></span> <span>{$Think.lang.merchant_entry_application}</span> </div>
<div class="main">
    <div class="sidebar">
        <div class="title">
            <h3>{$Think.lang.merchant_entry_application}</h3>
        </div>
        <div class="content">
            <dl>
                <dt class="{if $sub_step == 'step0'}current{/if}"> <i class="hide"></i>{$Think.lang.enter_agreement}</dt>
            </dl>
            <dl show_id="0">
                <dt onclick="show_list('0');" style="cursor: pointer;"> <i class="show"></i>{$Think.lang.submit_application}</dt>
                <dd>
                    <ul style='margin-left:26px;'>
                        <li ><i></i>{$Think.lang.store_qualification_information}</li>
                        <li ><i></i>{$Think.lang.financial_qualification_information}</li>
                        <li ><i></i>{$Think.lang.store_operation_information}</li>
                    </ul>
                </dd>
            </dl>
            <dl>
                <dt class="{if $sub_step == 'pay'}current{/if}"> <i class="hide"></i>{$Think.lang.contract_signing_payment}</dt>
            </dl>
            <dl>
                <dt> <i class="hide"></i>{$Think.lang.store_opening}</dt>
            </dl>
        </div>
       <!--  <div class="title">
           <h3>{$Think.lang.platform_contact}</h3>
       </div>
       <div class="content">
           <ul>
               <li>{$Think.lang.phone}：{$Think.config.site_phone}</li>
               <li>{$Think.lang.email}：{$Think.config.site_email}</li>
           </ul>
       </div> -->
    </div>
    <div class="right-layout">
        <div class="joinin-step">
            <ul>
                <li class="step1 {if $sub_step >= 'step0'}current{/if} {if $sub_step == 'pay'}current{/if}"><span>{$Think.lang.enter_agreement}</span></li>
                <li class="{if $sub_step >= 'step1'}current{/if} {if $sub_step == 'pay'}current{/if}"><span>{$Think.lang.store_qualification_information}</span></li>
                <li class="{if $sub_step >= 'step2'}current{/if} {if $sub_step == 'pay'}current{/if}"><span>{$Think.lang.financial_qualification_information}</span></li>
                <li class="{if $sub_step >= 'step3'}current{/if} {if $sub_step == 'pay'}current{/if}"><span>{$Think.lang.store_operation_information}</span></li>
                <li class="{if $sub_step >= 'step4'}current{/if} {if $sub_step == 'pay'}current{/if}"><span>{$Think.lang.contract_signing_payment}</span></li>
                <li class="step6"><span>{$Think.lang.store_opening}</span></li>
            </ul>
        </div>
        <div class="joinin-concrete">
<!-- 店铺信息 -->
<div id="apply_store_info" class="apply-store-info">
  <div class="alert">
    <h4>{$Think.lang.matters_needing_attention}：</h4>
    {$Think.lang.merchant_information1}</div>
    <form id="form_store_info" action="{:url('Sellerjoininc2c/step4')}" method="post" >
      <table border="0" cellpadding="0" cellspacing="0" class="all">
        <thead>
          <tr>
          <th colspan="20">{$Think.lang.store_operation_information}</th>
          </tr>
        </thead>
        <tbody>
        <tr>
          <th class="w150"><i>*</i>{$Think.lang.merchant_account}：</th>
          <td><input id="seller_name" readonly="readonly" name="seller_name" type="text" 
            value="{$member_name.member_name}" class="w200"/>
            <span></span>
            <p class="emphasis">{$Think.lang.merchant_information2}</p></td>
        </tr>
        <tr>
          <th class="w150"><i>*</i>{$Think.lang.store_name}：</th>
          <td><input name="store_name"  type="text" class="w200" value="{$member_name.company_name}"/>
            <span></span>
        </tr>
      </tbody>
      <tfoot>
        <tr>
          <td colspan="20">&nbsp;</td>
        </tr>
      </tfoot>
    </table>
  </form>
  <div class="bottom"><a id="btn_apply_store_next" href="javascript:;" class="btn">{$Think.lang.submit_application}</a>
  </div>
</div>
<script src="{$Think.PLUGINS_SITE_ROOT}/mlselection.js"></script>
<script type="text/javascript">

$(document).ready(function(){
    // gcategoryInit("gcategory");

    jQuery.validator.addMethod("seller_name_exist", function(value, element, params) {
        var result = true;
        $.ajax({
            type:"GET",
            url:"{:url('Sellerjoinin/check_seller_name_exist')}",
            async:false,
            data:{seller_name: $('#seller_name').val()},
            success: function(data){
                if(data == 'true') {
                    // $.validator.messages.seller_name_exist = "{$Think.lang.seller_account_already_exists}";
                    // result = false;
                }
            }
        });
        return result;
    }, '');

    $('#form_store_info').validate({
        errorPlacement: function(error, element){
            element.nextAll('span').first().after(error);
        },
        rules : {
            seller_name: {
                required: true,
                maxlength: 50,
                seller_name_exist: true
            },
           /* store_name: {
                required: true,
                maxlength: 50,
                remote : "{:url('Sellerjoinin/checkname')}"
            },*/
             store_seller_type: {
                 required: true
             },

        },
       messages : {
            seller_name: {
                required: '{$Think.lang.fill_seller_user_name}',
                maxlength: jQuery.validator.format("{$Think.lang.most_words}")
            },
            store_name: {
                required: '{$Think.lang.fill_store_name}',
                maxlength: jQuery.validator.format("{$Think.lang.most_words}"),
             /*   remote : '{$Think.lang.store_name_already_exists}'*/
            },
            store_seller_type: {
                 required: '{$Think.lang.select_store_type}'
            },
        }
    });

    $('#btn_apply_store_next').on('click', function() {
        $('#form_store_info').submit();
    });
});
    $("#store_seller_type").change(function(){  check_operators
        var operators_id = $(this).children('option:selected').val(); 
        if(operators_id == 1){ 
            //运营商
            $("#check_operators").show();
            $("#check_supplier").show();
            $("#check_wholesale").hide();
        }else{
            $("#check_operators").hide();
            $("#check_wholesale").show();
            $("#check_supplier").hide();
        }
    })
</script>














        </div>
    </div>
</div>


{/block}
